<!DOCTYPE HTML>
<html lang="en" >
    <!-- Start book 小熊的电子书 -->
    <head>
        <!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>JS | 小熊的电子书</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.9">
        <meta name="author" content="Melon">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-image-captions/image-captions.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../md/03js/if.html" />
    
    
    <link rel="prev" href="../../md/02css/tuozhan.html" />
    

        <!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
        
    <div class="book"
        data-level="3"
        data-chapter-title="JS"
        data-filepath="md/03js/JS.md"
        data-basepath="../.."
        data-revision="Fri Aug 28 2020 01:27:09 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="md/01html/HTML.html">
            
                
                    <a href="../../md/01html/HTML.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        HTML
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="md/01html/01label.html">
            
                
                    <a href="../../md/01html/01label.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        HTML标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="md/01html/route.html">
            
                
                    <a href="../../md/01html/route.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        路径问题
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="md/02css/CSS.html">
            
                
                    <a href="../../md/02css/CSS.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        CSS
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="md/02css/01_font.html">
            
                
                    <a href="../../md/02css/01_font.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        字体属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="md/02css/02_text.html">
            
                
                    <a href="../../md/02css/02_text.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        文本属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="md/02css/03_background.html">
            
                
                    <a href="../../md/02css/03_background.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        背景属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="md/02css/04_box.html">
            
                
                    <a href="../../md/02css/04_box.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        盒子box
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="md/02css/05_float.html">
            
                
                    <a href="../../md/02css/05_float.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        浮动float
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="md/02css/06_position.html">
            
                
                    <a href="../../md/02css/06_position.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        定位position
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="md/02css/07_transform.html">
            
                
                    <a href="../../md/02css/07_transform.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        变形transform
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="md/02css/08_transition.html">
            
                
                    <a href="../../md/02css/08_transition.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        过渡transition
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="md/02css/09_shadow.html">
            
                
                    <a href="../../md/02css/09_shadow.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.9.</b>
                        
                        阴影shadow
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="md/02css/10_selector.html">
            
                
                    <a href="../../md/02css/10_selector.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.</b>
                        
                        选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="md/02css/11_flex.html">
            
                
                    <a href="../../md/02css/11_flex.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.11.</b>
                        
                        弹性盒子flex
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.12" data-path="md/02css/12_animation.html">
            
                
                    <a href="../../md/02css/12_animation.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.12.</b>
                        
                        动画
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.13" data-path="md/02css/tuozhan.html">
            
                
                    <a href="../../md/02css/tuozhan.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.13.</b>
                        
                        拓展内容
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="3" data-path="md/03js/JS.html">
            
                
                    <a href="../../md/03js/JS.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        JS
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="md/03js/if.html">
            
                
                    <a href="../../md/03js/if.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        if语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="md/03js/Datatype.html">
            
                
                    <a href="../../md/03js/Datatype.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        数据类型的转换
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="md/03js/Number.html">
            
                
                    <a href="../../md/03js/Number.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        数值类型Number
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="md/03js/String.html">
            
                
                    <a href="../../md/03js/String.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        字符串String
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="md/03js/Array.html">
            
                
                    <a href="../../md/03js/Array.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        数组Array
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="md/03js/Array_bianli.html">
            
                
                    <a href="../../md/03js/Array_bianli.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        数组的遍历
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="md/03js/filter.html">
            
                
                    <a href="../../md/03js/filter.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        filter过滤
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="md/03js/Function.html">
            
                
                    <a href="../../md/03js/Function.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        function函数
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="md/03js/Time.html">
            
                
                    <a href="../../md/03js/Time.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        定时器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="md/03js/shijian.html">
            
                
                    <a href="../../md/03js/shijian.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        JS常用事件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.11" data-path="md/03js/Scope.html">
            
                
                    <a href="../../md/03js/Scope.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.11.</b>
                        
                        作用域-作用域链
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="md/04bootstrap/bootstrap.html">
            
                
                    <a href="../../md/04bootstrap/bootstrap.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        响应式Bootstrap
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5" data-path="md/05ajax/ajax.html">
            
                
                    <a href="../../md/05ajax/ajax.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        ajax
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6" data-path="md/06swiper/swiper.html">
            
                
                    <a href="../../md/06swiper/swiper.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        swiper
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7" data-path="md/07promote/promote.html">
            
                
                    <a href="../../md/07promote/promote.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        变量提升和函数提升
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8" data-path="md/08Rendering/rendering.html">
            
                
                    <a href="../../md/08Rendering/rendering.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        浏览器的渲染问题
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="8.1" data-path="md/08Rendering/Reflow_Redraw.html">
            
                
                    <a href="../../md/08Rendering/Reflow_Redraw.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.1.</b>
                        
                        回流和重绘
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="9" data-path="md/09event/progress.html">
            
                
                    <a href="../../md/09event/progress.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.</b>
                        
                        小事件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10" data-path="md/10createObject/createObject.html">
            
                
                    <a href="../../md/10createObject/createObject.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.</b>
                        
                        创建对象的模式
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="10.1" data-path="md/10createObject/FactoryModel.html">
            
                
                    <a href="../../md/10createObject/FactoryModel.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.1.</b>
                        
                        工厂模式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.2" data-path="md/10createObject/Constructor.html">
            
                
                    <a href="../../md/10createObject/Constructor.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.2.</b>
                        
                        构造函数
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.3" data-path="md/10createObject/PrototypePattern.html">
            
                
                    <a href="../../md/10createObject/PrototypePattern.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.3.</b>
                        
                        原型模式和混合模式
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="11" data-path="md/11PrototypeChain/PrototypeChain.html">
            
                
                    <a href="../../md/11PrototypeChain/PrototypeChain.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.</b>
                        
                        原型链
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="12" data-path="md/12this/this.html">
            
                
                    <a href="../../md/12this/this.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>12.</b>
                        
                        this
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="13" data-path="md/13eventDelegate/eventDelegate.html">
            
                
                    <a href="../../md/13eventDelegate/eventDelegate.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>13.</b>
                        
                        事件代理/事件委托
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="14" data-path="md/14SynaSyn/synAsyn.html">
            
                
                    <a href="../../md/14SynaSyn/synAsyn.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>14.</b>
                        
                        同步&amp;异步任务
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="15" data-path="md/15fdjl/fdjl.html">
            
                
                    <a href="../../md/15fdjl/fdjl.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>15.</b>
                        
                        防抖&amp;节流
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="16" data-path="md/16ES6/ES6.html">
            
                
                    <a href="../../md/16ES6/ES6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>16.</b>
                        
                        ES6
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="16.1" data-path="md/16ES6/letconst.html">
            
                
                    <a href="../../md/16ES6/letconst.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>16.1.</b>
                        
                        let/const
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="16.2" data-path="md/16ES6/deconstruction.html">
            
                
                    <a href="../../md/16ES6/deconstruction.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>16.2.</b>
                        
                        解构赋值
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="16.3" data-path="md/16ES6/Promise.html">
            
                
                    <a href="../../md/16ES6/Promise.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>16.3.</b>
                        
                        Promise
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="16.4" data-path="md/16ES6/async&amp;await.html">
            
                
                    <a href="../../md/16ES6/async&amp;await.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>16.4.</b>
                        
                        async&amp;await
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="16.5" data-path="md/16ES6/class.html">
            
                
                    <a href="../../md/16ES6/class.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>16.5.</b>
                        
                        class
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="16.6" data-path="md/16ES6/module.html">
            
                
                    <a href="../../md/16ES6/module.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>16.6.</b>
                        
                        module
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="16.7" data-path="md/16ES6/Set.html">
            
                
                    <a href="../../md/16ES6/Set.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>16.7.</b>
                        
                        Set
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="16.8" data-path="md/16ES6/Map.html">
            
                
                    <a href="../../md/16ES6/Map.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>16.8.</b>
                        
                        Map
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="17" data-path="md/17garbageCollection/garbageCollection.html">
            
                
                    <a href="../../md/17garbageCollection/garbageCollection.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>17.</b>
                        
                        垃圾回收机制
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="18" data-path="md/18closure/closure.html">
            
                
                    <a href="../../md/18closure/closure.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>18.</b>
                        
                        闭包
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="19" data-path="md/19Vue/vue.html">
            
                
                    <a href="../../md/19Vue/vue.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>19.</b>
                        
                        Vue
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="19.1" data-path="md/19Vue/模板语法.html">
            
                
                    <a href="../../md/19Vue/模板语法.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>19.1.</b>
                        
                        模板语法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="19.2" data-path="md/19Vue/条件渲染.html">
            
                
                    <a href="../../md/19Vue/条件渲染.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>19.2.</b>
                        
                        条件渲染
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="19.3" data-path="md/19Vue/列表渲染.html">
            
                
                    <a href="../../md/19Vue/列表渲染.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>19.3.</b>
                        
                        列表渲染
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="19.4" data-path="md/19Vue/class&amp;style.html">
            
                
                    <a href="../../md/19Vue/class&amp;style.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>19.4.</b>
                        
                        class&amp;style
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="19.5" data-path="md/19Vue/v-model.html">
            
                
                    <a href="../../md/19Vue/v-model.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>19.5.</b>
                        
                        v-model
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="19.6" data-path="md/19Vue/computed.html">
            
                
                    <a href="../../md/19Vue/computed.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>19.6.</b>
                        
                        计算属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="19.7" data-path="md/19Vue/watch侦听.html">
            
                
                    <a href="../../md/19Vue/watch侦听.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>19.7.</b>
                        
                        watch侦听
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="19.8" data-path="md/19Vue/filter.html">
            
                
                    <a href="../../md/19Vue/filter.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>19.8.</b>
                        
                        过滤器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="19.9" data-path="md/19Vue/组件.html">
            
                
                    <a href="../../md/19Vue/组件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>19.9.</b>
                        
                        局部&amp;全局组件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="19.10" data-path="md/19Vue/通讯&amp;传递信息.html">
            
                
                    <a href="../../md/19Vue/通讯&amp;传递信息.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>19.10.</b>
                        
                        通讯&amp;传递信息
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="19.11" data-path="md/19Vue/动态组件&amp;keepAlive.html">
            
                
                    <a href="../../md/19Vue/动态组件&amp;keepAlive.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>19.11.</b>
                        
                        动态组件&amp;keepAlive
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="19.12" data-path="md/19Vue/插槽slot.html">
            
                
                    <a href="../../md/19Vue/插槽slot.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>19.12.</b>
                        
                        插槽slot
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="19.13" data-path="md/19Vue/过渡和动画.html">
            
                
                    <a href="../../md/19Vue/过渡和动画.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>19.13.</b>
                        
                        过渡和动画
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="19.14" data-path="md/19Vue/生命周期.html">
            
                
                    <a href="../../md/19Vue/生命周期.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>19.14.</b>
                        
                        生命周期
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="20" data-path="md/20vue-route/vue路由.html">
            
                
                    <a href="../../md/20vue-route/vue路由.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>20.</b>
                        
                        Vue路由router
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="21" data-path="md/Interview/Interview.html">
            
                
                    <a href="../../md/Interview/Interview.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>21.</b>
                        
                        JS面试题
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >小熊的电子书</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="js">JS</h1>
<h3 id="&#x5168;&#x79F0;&#xFF1A;javascript--&#x662F;&#x4E00;&#x79CD;&#x4E13;&#x95E8;&#x4E3A;&#x7F51;&#x9875;&#x4EA4;&#x4E92;&#x800C;&#x8BBE;&#x8BA1;&#x7684;&#x811A;&#x672C;&#x8BED;&#x8A00;&#xFF0C;&#x7531;&#x4E09;&#x4E2A;&#x4E0D;&#x540C;&#x90E8;&#x5206;">&#x5168;&#x79F0;&#xFF1A;JavaScript  &#x662F;&#x4E00;&#x79CD;&#x4E13;&#x95E8;&#x4E3A;&#x7F51;&#x9875;&#x4EA4;&#x4E92;&#x800C;&#x8BBE;&#x8BA1;&#x7684;&#x811A;&#x672C;&#x8BED;&#x8A00;&#xFF0C;&#x7531;&#x4E09;&#x4E2A;&#x4E0D;&#x540C;&#x90E8;&#x5206;</h3>
<ul>
<li>ECMAScript,   &#x8BED;&#x6CD5;&#xFF0C;&#x8BED;&#x53E5;&#xFF0C;&#x5173;&#x952E;&#x5B57;&#xFF0C;&#x4FDD;&#x7559;&#x5B57;&#xFF0C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#xFF0C;object   </li>
<li>DOM (Document Object Model) &#x6587;&#x6863;&#x5BF9;&#x8C61;&#x6A21;&#x578B;&#xFF0C;&#x63D0;&#x4F9B;&#x8BBF;&#x95EE;&#x548C;&#x64CD;&#x4F5C;&#x7F51;&#x9875;&#x5185;&#x5BB9;&#x7684;&#x65B9;&#x6CD5;&#x548C;&#x63A5;&#x53E3;&#xFF1B;  </li>
<li>BOM (Browser Object Model) &#x6D4F;&#x89C8;&#x5668;&#x5BF9;&#x8C61;&#x6A21;&#x578B;&#xFF0C;&#x63D0;&#x4F9B;&#x4E0E;&#x6D4F;&#x89C8;&#x5668;&#x4EA4;&#x4E92;&#x7684;&#x65B9;&#x6CD5;&#x548C;&#x63A5;&#x53E3;&#xFF1B;</li>
</ul>
<h3 id="&#x6807;&#x7B7E;-scriptscript">&#x6807;&#x7B7E; <code>&lt;script&gt;&lt;/script&gt;</code>:</h3>
<ul>
<li>&#x5C5E;&#x6027;&#x503C;&#xFF1A;<ul>
<li>async&#xFF1A;&#x53EF;&#x9009;&#x3002;&#x8868;&#x793A;&#x5E94;&#x8BE5;&#x7ACB;&#x5373;&#x4E0B;&#x8F7D;&#x811A;&#x672C;&#xFF0C;&#x4F46;&#x4E0D;&#x59A8;&#x788D;&#x9875;&#x9762;&#x4E2D;&#x7684;&#x5176;&#x4ED6;&#x64CD;&#x4F5C;&#xFF0C;&#x6BD4;&#x5982;&#x4E0B;&#x8F7D;&#x5176;&#x4ED6;&#x8D44;&#x6E90;&#x6216;&#x7B49;&#x5F85;&#x52A0;&#x8F7D;&#x5176;&#x4ED6;&#x811A;&#x672C;&#xFF0C;&#x53EA;&#x5BF9;&#x5916;&#x90E8;&#x811A;&#x672C;&#x6587;&#x4EF6;&#x6709;&#x6548;&#xFF1B;</li>
<li>charset&#xFF1A;&#x53EF;&#x9009;&#x3002;&#x8868;&#x793A;&#x901A;&#x8FC7;src&#x5C5E;&#x6027;&#x6307;&#x5B9A;&#x7684;&#x4EE3;&#x7801;&#x7684;&#x5B57;&#x7B26;&#x96C6;&#xFF1B;&#x7531;&#x4E8E;&#x73B0;&#x5728;&#x5927;&#x90E8;&#x5206;&#x6D4F;&#x89C8;&#x5668;&#x4F1A;&#x5FFD;&#x7565;&#x6389;&#x4ED6;&#x7684;&#x503C;&#xFF0C;&#x56E0;&#x6B64;&#x8FD9;&#x4E2A;&#x5C5E;&#x6027;&#x5F88;&#x5C11;&#x4EBA;&#x7528;&#xFF1B;</li>
<li><strong>defer</strong>&#xFF1A;&#x53EF;&#x9009;&#x3002;&#x8868;&#x793A;&#x811A;&#x672C;&#x53EF;&#x4EE5;&#x5EF6;&#x8FDF;&#x5230;&#x6587;&#x6863;&#x5B8C;&#x5168;&#x88AB;&#x89E3;&#x6790;&#x548C;&#x663E;&#x793A;&#x4E4B;&#x540E;&#x5728;&#x6267;&#x884C;&#x3002;&#x53EA;&#x4F1A;&#x5916;&#x90E8;&#x811A;&#x672C;&#x6587;&#x4EF6;&#x6709;&#x6548;&#xFF0C;IE7&#x4E4B;&#x524D;&#x4E5F;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x3002;&#xFF08;&#x91CD;&#x8981;&#xFF09;</li>
<li>src&#xFF1A;&#x53EF;&#x9009;&#x3002;&#x8868;&#x793A;&#x5305;&#x542B;&#x8981;&#x6267;&#x884C;&#x4EE3;&#x7801;&#x7684;&#x5916;&#x90E8;&#x6587;&#x4EF6;&#x3002;</li>
<li>type&#xFF1A;&#x5FC5;&#x9009;&#x3002;&#x53EF;&#x4EE5;&#x770B;&#x6210;&#x662F;language&#xFF08;&#x5DF2;&#x5E9F;&#x5F03;&#xFF09;&#x7684;&#x66FF;&#x4EE3;&#x5C5E;&#x6027;&#xFF1B;&#x8868;&#x793A;&#x7F16;&#x5199;&#x4EE3;&#x7801;&#x4F7F;&#x7528;&#x7684;&#x811A;&#x672C;&#x8BED;&#x8A00;&#x7684;&#x5185;&#x5BB9;&#x7C7B;&#x578B;&#xFF08;&#x4E5F;&#x79F0;MIME&#x7C7B;&#x578B;&#xFF09;&#x3002;&#x867D;&#x7136;text/javaScript&#x548C;text/ecmascript&#x90FD;&#x4E0D;&#x600E;&#x4E48;&#x63A8;&#x8350;&#x4F7F;&#x7528;&#x4E86;&#xFF0C;&#x4F46;&#x5927;&#x90E8;&#x5206;&#x7528;&#x5230;&#x7684;&#x8FD8;&#x662F;text/javaScript&#xFF0C;&#x9ED8;&#x8BA4;&#x503C;&#x4E5F;&#x662F;text/javaScript&#xFF1B;</li>
</ul>
</li>
</ul>
<h4 id="&#x5F15;&#x7528;&#xFF1A;&#x884C;&#x5185;&#xFF08;&#x4E00;&#x822C;&#x90FD;&#x4E0D;&#x4F7F;&#x7528;&#xFF09;-&#x9875;&#x5185;&#xFF08;&#x6700;&#x597D;&#x5199;&#x5728;body&#x6700;&#x4E0B;&#x9762;&#xFF09;-&#x9875;&#x5916;">&#x5F15;&#x7528;&#xFF1A;&#x884C;&#x5185;&#xFF08;&#x4E00;&#x822C;&#x90FD;&#x4E0D;&#x4F7F;&#x7528;&#xFF09; &#x9875;&#x5185;&#xFF08;&#x6700;&#x597D;&#x5199;&#x5728;body&#x6700;&#x4E0B;&#x9762;&#xFF09; &#x9875;&#x5916;</h4>
<ul>
<li><p>&#x76F8;&#x5BF9;&#x8DEF;&#x5F84;  &#x201C;/&#x201D;:&#x6839;&#x76EE;&#x5F55;</p>
<pre><code>     &#x201C;./&#x201D;:&#x5F53;&#x524D;&#x76EE;&#x5F55;
     &#x201C;../&#x201D;:&#x4E0A;&#x4E00;&#x5C42;&#x76EE;&#x5F55;
</code></pre></li>
<li><p>JS&#x662F;&#x4EC0;&#x4E48;&#xFF1F;    </p>
<ul>
<li>JS&#x662F;&#x4E00;&#x79CD; &#x5F31;&#x7C7B;&#x578B;  &#x76F4;&#x8BD1;&#x5F0F;  &#x811A;&#x672C;&#x8BED;&#x8A00;<ul>
<li>&#x5F31;&#x7C7B;&#x578B;&#xFF1A; JS  &#x5F3A;&#x7C7B;&#x578B;&#x4F8B;&#x5982; C++ JAVA</li>
<li>&#x76F4;&#x8BD1;&#x5F0F;&#xFF1A;JS   &#x7F16;&#x8BD1;&#x5F0F;&#xFF1A;JAVA</li>
<li>&#x811A;&#x672C;&#x8BED;&#x8A00; &#x5982;&#xFF1A;XSS&#x653B;&#x51FB;  &#x76D7;&#x53D6;cookie&#x503C;</li>
</ul>
</li>
</ul>
</li>
<li>2.JS&#x7684;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x6709;&#x54EA;&#x51E0;&#x79CD;&#xFF0C;&#x54EA;&#x4E9B;&#x662F;&#x7B80;&#x5355;&#x7C7B;&#x578B;&#x53D8;&#x91CF;&#xFF0C;&#x54EA;&#x4E9B;&#x662F;&#x590D;&#x6742;&#x7C7B;&#x578B;&#x53D8;&#x91CF;&#xFF1F;<ul>
<li>&#x6570;&#x636E;&#x7C7B;&#x578B; String&#xFF0C;Number&#xFF0C;Blooean&#xFF0C;Null&#xFF0C;Underfined&#xFF0C;object&#xFF08;Array Function Object&#xFF09;</li>
<li>&#x7B80;&#x5355;&#x7C7B;&#x578B;&#x53D8;&#x91CF;&#xFF1A;&#x7B80;&#x5355;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x53C8;&#x88AB;&#x53EB;&#x505A;&#x57FA;&#x672C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x6216;&#x8005;&#x503C;&#x7C7B;&#x578B;&#xFF0C;&#x5B58;&#x50A8;&#x53D8;&#x91CF;&#x65F6;&#x5B58;&#x50A8;&#x7684;&#x662F;&#x503C;&#x672C;&#x8EAB;  String&#xFF0C;Number&#xFF0C;Blooean&#xFF0C;Null&#xFF0C;Underfined&#xFF0C;Symbol&#xFF08;&#x552F;&#x4E00;&#x7684;&#x4E0D;&#x91CD;&#x590D;&#x7684;&#x57FA;&#x672C;&#x503C;&#xFF09;</li>
<li>&#x590D;&#x6742;&#x7C7B;&#x578B;&#x53D8;&#x91CF;&#xFF1A;&#x901A;&#x8FC7;new&#x5173;&#x952E;&#x5B57;&#x521B;&#x5EFA;&#x7684;&#x5BF9;&#x8C61;&#xFF08;&#x7CFB;&#x7EDF;&#x5BF9;&#x8C61;&#xFF0C;&#x81EA;&#x5B9A;&#x4E49;&#x5BF9;&#x8C61;&#xFF09;&#xFF0C;&#x5982;Object&#xFF1A;Array,Date,function</li>
</ul>
</li>
<li>3.&#x7528;&#x4EE3;&#x7801;&#x6765;&#x8868;&#x793A;&#x5177;&#x4F53;&#x5982;&#x4F55;&#x5B9A;&#x4E49;JS&#x7684;&#x5404;&#x79CD;&#x7C7B;&#x578B;&#x53D8;&#x91CF;&#xFF1F;<ul>
<li>ES5<ul>
<li>var&#x5B9A;&#x4E49;&#x7684;&#x53D8;&#x91CF;&#x53EF;&#x4EE5;&#x4FEE;&#x6539;&#xFF0C;&#x5982;&#x679C;&#x4E0D;&#x521D;&#x59CB;&#x5316;&#x4F1A;&#x8F93;&#x51FA;undefined&#xFF0C;&#x4E0D;&#x4F1A;&#x62A5;&#x9519;&#x3002;</li>
</ul>
</li>
<li>ES6<ul>
<li>1.const&#x5B9A;&#x4E49;&#x7684;&#x53D8;&#x91CF;&#x4E0D;&#x53EF;&#x4EE5;&#x4FEE;&#x6539;&#xFF0C;&#x800C;&#x4E14;&#x5FC5;&#x987B;&#x521D;&#x59CB;&#x5316;&#x3002;</li>
<li>2.let&#x662F;&#x5757;&#x7EA7;&#x4F5C;&#x7528;&#x57DF;&#xFF0C;&#x51FD;&#x6570;&#x5185;&#x90E8;&#x4F7F;&#x7528;let&#x5B9A;&#x4E49;&#x540E;&#xFF0C;&#x5BF9;&#x51FD;&#x6570;&#x5916;&#x90E8;&#x65E0;&#x5F71;&#x54CD;&#x3002;&#xFF08;&#x65E0;&#x6CD5;&#x5B9A;&#x4E49;&#x5230;window ,&#x8FD4;&#x56DE;undefined&#xFF09;</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2 id="&#x7F51;&#x9875;&#x52A0;&#x8F7D;&#xFF08;&#x6E32;&#x67D3;&#xFF09;&#x5B8C;&#x6210;&#x4EE5;&#x540E;&#x518D;&#x6267;&#x884C;&#x51FD;&#x6570;">&#x7F51;&#x9875;&#x52A0;&#x8F7D;&#xFF08;&#x6E32;&#x67D3;&#xFF09;&#x5B8C;&#x6210;&#x4EE5;&#x540E;&#x518D;&#x6267;&#x884C;&#x51FD;&#x6570;</h2>
<ul>
<li>window.onload = function() {
console.log(document.querySelector(&quot;h1&quot;));
}   </li>
<li>window.addEventListener(&quot;load&quot;,function(){
console.log(document.querySelector(&quot;h1&quot;));
})   </li>
<li>window.addEventListener(&quot;DOMContentLoaded&quot;,function(){console.log(document.querySelector(&quot;h1&quot;));})</li>
<li>&#x9875;&#x5916;&#x5F15;&#x5165;  defer &#x5EF6;&#x8FDF;&#x5F15;&#x5165; &#x53EA;&#x9488;&#x5BF9;&#x9875;&#x5916;&#x5F15;&#x5165;<ul>
<li><code>&lt;script src=&quot;js/index.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot; defer &gt;&lt;/script&gt;</code></li>
</ul>
</li>
<li>&#x9875;&#x5C3E;&#x5F15;&#x5165;</li>
</ul>
<h1 id="domcontentloaded&#x548C;load&#x4E8B;&#x4EF6;&#x7684;&#x533A;&#x522B;">DOMContentLoaded&#x548C;load&#x4E8B;&#x4EF6;&#x7684;&#x533A;&#x522B;</h1>
<ul>
<li>DOMContentLoaded:dom&#x5185;&#x5BB9;&#x52A0;&#x8F7D;&#x5B8C;&#x6BD5;&#xFF1B;<ul>
<li>&#x5F53;&#x6587;&#x6863;&#x4E2D;&#x6CA1;&#x6709;&#x811A;&#x672C;&#x65F6;&#xFF0C;&#x6D4F;&#x89C8;&#x5668;&#x89E3;&#x6790;&#x5B8C;&#x6587;&#x6863;&#x624D;&#x80FD;&#x89E6;&#x53D1; DOMContentLoaded &#x4E8B;&#x4EF6;&#xFF1B;</li>
<li>&#x5982;&#x679C;&#x6587;&#x6863;&#x4E2D;&#x5305;&#x542B;&#x811A;&#x672C;&#xFF0C;&#x5219;&#x811A;&#x672C;&#x4F1A;&#x963B;&#x585E;&#x6587;&#x6863;&#x7684;&#x89E3;&#x6790;&#xFF08;javascript&#x53EF;&#x4EE5;&#x67E5;&#x8BE2;&#x5BF9;&#x8C61;&#x7684;&#x6837;&#x5F0F;&#xFF09;&#x5982;&#x679C;&#x5728;&#x6807;&#x7B7E;&#x524D;&#x9762;&#x6709;&#x6837;&#x5F0F;&#x6587;&#x4EF6;&#xFF0C;&#x9700;&#x8981;&#x6837;&#x5F0F;&#x6587;&#x4EF6;&#x52A0;&#x8F7D;&#x5E76;&#x89E3;&#x6790;&#x5B8C;&#x6BD5;&#x540E;&#x624D;&#x6267;&#x884C;&#x811A;&#x672C;&#x3002;</li>
<li>&#x5728;&#x4EFB;&#x4F55;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;DOMContentLoaded &#x7684;&#x89E6;&#x53D1;&#x4E0D;&#x9700;&#x8981;&#x7B49;&#x5F85;&#x56FE;&#x7247;&#x7B49;&#x5176;&#x4ED6;&#x8D44;&#x6E90;&#x52A0;&#x8F7D;&#x5B8C;&#x6210;</li>
<li>DOMContentLoaded&#x4E0D;&#x540C;&#x7684;&#x6D4F;&#x89C8;&#x5668;&#x5BF9;&#x5176;&#x652F;&#x6301;&#x4E0D;&#x540C;&#xFF0C;&#x6240;&#x4EE5;&#x5728;&#x5B9E;&#x73B0;&#x7684;&#x65F6;&#x5019;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x505A;&#x4E0D;&#x540C;&#x6D4F;&#x89C8;&#x5668;&#x7684;&#x517C;&#x5BB9;</li>
<li>IE6&#x3001;IE7-&#x652F;&#x6301;onreadystatechange&#x4E8B;&#x4EF6;&#xFF08;&#x63D0;&#x4F9B;&#x4E0E;&#x6587;&#x6863;&#x6216;&#x5143;&#x7D20;&#x7684;&#x52A0;&#x8F7D;&#x72B6;&#x6001;&#x6709;&#x5173;&#x7684;&#x4FE1;&#x606F;&#xFF09;</li>
</ul>
</li>
<li>load&#x4E8B;&#x4EF6;&#xFF1A;<ul>
<li>&#x9875;&#x9762;&#x4E0A;&#x6240;&#x6709;&#x7684;&#x8D44;&#x6E90;&#xFF08;&#x56FE;&#x7247;&#xFF0C;&#x97F3;&#x9891;&#xFF0C;&#x89C6;&#x9891;&#x7B49;&#xFF09;&#x88AB;&#x52A0;&#x8F7D;&#x4EE5;&#x540E;&#x624D;&#x4F1A;&#x89E6;&#x53D1;load&#x4E8B;&#x4EF6;</li>
<li>&#x9875;&#x9762;&#x7684;load&#x4E8B;&#x4EF6;&#x4F1A;&#x5728;DOMContentLoaded&#x88AB;&#x89E6;&#x53D1;&#x4E4B;&#x540E;&#x624D;&#x89E6;&#x53D1;</li>
<li>onload&#x4E8B;&#x4EF6;&#x6240;&#x6709;&#x7684;&#x6D4F;&#x89C8;&#x5668;&#x90FD;&#x652F;&#x6301;window.onload = function(){}</li>
</ul>
</li>
</ul>
<h1 id="async&#x548C;defer&#x7684;&#x533A;&#x522B;">async&#x548C;defer&#x7684;&#x533A;&#x522B;</h1>
<ul>
<li>defer&#xFF1A;&#x7528;&#x4E8E;&#x5F00;&#x542F;&#x65B0;&#x7684;&#x7EBF;&#x7A0B;&#x4E0B;&#x8F7D;&#x811A;&#x672C;&#x6587;&#x4EF6;&#xFF0C;&#x5E76;&#x4F7F;&#x811A;&#x672C;&#x5728;&#x6587;&#x6863;&#x89E3;&#x6790;&#x5B8C;&#x6210;&#x540E;&#x6267;&#x884C;<ul>
<li>HTML5&#x4E2D;&#x987A;&#x5E8F;&#x6267;&#x884C;&#x5EF6;&#x8FDF;&#x811A;&#x672C;&#xFF0C;&#x73B0;&#x5B9E;&#x4E2D;&#x4E0D;&#x4E00;&#x5B9A;&#x6309;&#x987A;&#x5E8F;&#xFF0C;&#x6700;&#x597D;&#x53EA;&#x5305;&#x542B;&#x4E00;&#x4E2A;&#x5EF6;&#x8FDF;&#x811A;&#x672C;</li>
</ul>
</li>
<li>async&#xFF1A;&#x5F02;&#x6B65;&#x4E0B;&#x8F7D;&#x811A;&#x672C;&#x6587;&#x4EF6;&#xFF0C;&#x4E0B;&#x8F7D;&#x5B8C;&#x6BD5;&#x7ACB;&#x5373;&#x89E3;&#x91CA;&#x6267;&#x884C;&#x4EE3;&#x7801;<ul>
<li>&#x4E0D;&#x8BA9;&#x9875;&#x9762;&#x7B49;&#x5F85;&#x4E24;&#x4E2A;&#x811A;&#x672C;&#x4E0B;&#x8F7D;&#x548C;&#x6267;&#x884C;&#xFF0C;&#x4ECE;&#x800C;&#x5F02;&#x6B65;&#x52A0;&#x8F7D;&#x9875;&#x9762;&#x5176;&#x4ED6;&#x5185;&#x5BB9;</li>
</ul>
</li>
<li>async&#x6BD4;&#x8F83;&#x9002;&#x7528;&#x4E8E;&#x767E;&#x5EA6;&#x5206;&#x6790;&#x6216;&#x8005;&#x8C37;&#x6B4C;&#x5206;&#x6790;&#x8FD9;&#x7C7B;&#x4E0D;&#x4F9D;&#x8D56;&#x5176;&#x4ED6;&#x811A;&#x672C;&#x7684;&#x5E93;</li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../md/02css/tuozhan.html" class="navigation navigation-prev " aria-label="Previous page: 拓展内容"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../md/03js/if.html" class="navigation navigation-next " aria-label="Next page: if语句"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"image-captions":{"attributes":{"style":"left: 50%;position: relative;transform: translateX(-50%);"},"caption":"图 _PAGE_LEVEL_._PAGE_IMAGE_NUMBER_ - _CAPTION_","align":"center","variable_name":"_pictures"},"fontsettings":{"theme":"night","family":"sans","size":2},"toggle-chapters":{},"highlight":{}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
    </body>
    <!-- End of book 小熊的电子书 -->
</html>
